projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dbc9b5
)
api: storage: Avoid enumeration for non-configured subsystem
author
Emmanuel Vadot
<
[email protected]
>
Wed, 19 Oct 2016 15:19:47 +0000
(17:19 +0200)
committer
Tom Rini
<
[email protected]
>
Mon, 24 Oct 2016 12:04:43 +0000
(08:04 -0400)
If a subsystem wasn't configured, avoid enumeration.
Signed-off-by: Emmanuel Vadot <
[email protected]
>
api/api_storage.c
patch
|
blob
|
history
diff --git
a/api/api_storage.c
b/api/api_storage.c
index d425a9ad1dbd7fce338e3065b294561c732a4120..b5aaba1091e6d875eadb8bc5289f27e9bf14a5aa 100644
(file)
--- a/
api/api_storage.c
+++ b/
api/api_storage.c
@@
-41,7
+41,7
@@
struct stor_spec {
char *name;
};
-static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0,
""
}, };
+static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0,
NULL
}, };
void dev_stor_init(void)
@@
-105,6
+105,10
@@
static int dev_stor_get(int type, int first, int *more, struct device_info *di)
struct blk_desc *dd;
+ /* Wasn't configured for this type, return 0 directly */
+ if (specs[type].name == NULL)
+ return 0;
+
if (first) {
di->cookie = (void *)blk_get_dev(specs[type].name, 0);
if (di->cookie == NULL)